//
//  CitySelectView.m
//  lvtu
//
//  Created by martin on 12-9-2.
//
//

#import "CitySelectView.h"

@implementation CitySelectView

- (id)initWithFrame:(CGRect)frame
{
    self = [super initWithFrame:frame];
    if (self) {
        // Initialization code
        UIImage *bgImage = [[UIImage alloc] initWithContentsOfFile:[[NSBundle mainBundle] pathForResource:@"bg_whiteframe.png" ofType:nil]];
        [self setImage:[bgImage stretchableImageWithLeftCapWidth:30 topCapHeight:10]];
        [bgImage release];
        
        nameLabel = [[UILabel alloc] initWithFrame:CGRectMake(20, 12, 50, 20)];
        nameLabel.font = [UIFont boldSystemFontOfSize:12];
        nameLabel.backgroundColor = [UIColor clearColor];
        nameLabel.textColor = [UIColor colorWithRed:153/255.0 green:153/255.0 blue:153/255.0 alpha:1.0];
        nameLabel.textAlignment = UITextAlignmentLeft;
        nameLabel.text = @"目的地：";
		[self addSubview:nameLabel];
        
        cityNameLabel = [[UILabel alloc] initWithFrame:CGRectMake(70, 12, 140, 20)];
        cityNameLabel.font = [UIFont boldSystemFontOfSize:14];
        cityNameLabel.backgroundColor = [UIColor clearColor];
        cityNameLabel.textColor = [UIColor colorWithRed:252/255.0 green:100/255.0 blue:22/255.0 alpha:1.0];
        cityNameLabel.textAlignment = UITextAlignmentCenter;
//        cityNameLabel.text = @"北京";
		[self addSubview:cityNameLabel];
    }
    return self;
}

- (void)dealloc
{
    [nameLabel release];nameLabel = nil;
    [cityNameLabel release];cityNameLabel = nil;
    [super dealloc];
}

- (void)setCityInfo:(CityInfo*)info
{
    cityNameLabel.text = info.name;
}
/*
// Only override drawRect: if you perform custom drawing.
// An empty implementation adversely affects performance during animation.
- (void)drawRect:(CGRect)rect
{
    // Drawing code
}
*/

@end
